package com.roden.study.examples.org.apache.shardingsphere.elasticjob;

import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;

public class MyJob implements SimpleJob {
    
    @Override
    public void execute(ShardingContext context) {
       task(context);      
    }
    public void task(ShardingContext context){
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("当前分片：" + context.getShardingItem() + "=====" + "参数：" + context.getShardingParameter() + " =====" + Thread.currentThread());
        try {
            Thread.sleep(5000);
            System.out.println("end");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}